package com.sivadas.anand.service;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sivadas.anand.dao.EmployeeDAO;
import com.sivadas.anand.entity.EmployeeEntity;

@Service
public class EmployeeServiceImpl implements EmployeeService {

	@Autowired
	private EmployeeDAO employeeDAO;

	@Transactional
	public void addEmployee(EmployeeEntity employee) {

		employeeDAO.addEmployee(employee);
	}

	@Transactional
	public List<EmployeeEntity> listEmployees() {

		return employeeDAO.getAllEmployees();
	}

	@Transactional
	public void removeEmployee(Integer id) {

		employeeDAO.deleteEmployee(id);
	}

}
